<?php

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

namespace Shuka189\Controller;

/**
 * Description of Login
 *
 * @author SoChishun
 */
class Login extends \Think\Controller {

    public function index() {
        $this->display();
    }
    public function loginAction($user_name='',$password='',$captcha=''){
        $result=\XWAM\Model\LoginModel::login($user_name,$password,$captcha,$msg);
        if($result){
            redirect(U('Index/index'));
        }else{
            $this->error($msg);
        }
    }

    public function logout() {
        \XWAM\Model\LoginModel::logout();
        redirect(U('Login/index'));
    }
}
